﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:WPFDataEditors.RichTextBox.Control"
                  >
    <Style TargetType="{x:Type local:RichTextBox}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:RichTextBox}">
                    <Border Background="{TemplateBinding Background}" 
                       BorderBrush="{TemplateBinding BorderBrush}"
                       BorderThickness="{TemplateBinding BorderThickness}"
                       CornerRadius="3">
                        <Border.Resources>
                            <Style TargetType="Image">
                                <Setter Property="SnapsToDevicePixels" Value="True"/>
                            </Style>
                        </Border.Resources>
                        <DockPanel LastChildFill="True">
                            <ToolBar x:Name="ToolBarUnten" DockPanel.Dock="Top">
                                <ComboBox x:Name="fontComboFast" ItemsSource="{Binding Source={x:Static Member=Fonts.SystemFontFamilies}}" MinWidth="100" MaxWidth="125" >
                                    <ComboBox.ItemsPanel>
                                        <ItemsPanelTemplate>
                                            <VirtualizingStackPanel />
                                        </ItemsPanelTemplate>
                                    </ComboBox.ItemsPanel>
                                    <ComboBox.ItemTemplate>
                                        <DataTemplate>
                                            <TextBlock Text="{Binding}" FontFamily="{Binding}" FontSize="15" Height="20"/>
                                        </DataTemplate>
                                    </ComboBox.ItemTemplate>
                                </ComboBox>
                                <ComboBox x:Name="fontSizeCombo" Height="23" Width="40" Margin="5,2,5,2" IsEditable="True">
                                 </ComboBox>
                                <Separator/>
                                <ToggleButton x:Name="ToolStripButtonBold" Command="EditingCommands.ToggleBold" ToolTip="Bold">
                                    <Image Source="..\Images\Bold.png" Stretch="None"/>
                                </ToggleButton>
                                <ToggleButton x:Name="ToolStripButtonItalic" Command="EditingCommands.ToggleItalic" ToolTip="Italic">
                                    <Image Source="..\Images\Italic.png" Stretch="None"/>
                                </ToggleButton>
                                <ToggleButton x:Name="ToolStripButtonUnderline" Command="EditingCommands.ToggleUnderline" ToolTip="Underline">
                                    <Image Source="..\Images\Underline.png" Stretch="None"/>
                                </ToggleButton>
                                <ToggleButton x:Name="ToolStripButtonStrikeout" ToolTip="Strikeout" >
                                    <Image Source="..\Images\Strikeout.png" Stretch="None"/>
                                </ToggleButton>
                                <Separator/>
                                <Separator/>
                                <ToggleButton x:Name="ToolStripButtonAlignLeft" Command="EditingCommands.AlignLeft" ToolTip="Align Left" >
                                    <Image Source="..\Images\AlignLeft.png" Stretch="None"/>
                                </ToggleButton>
                                <ToggleButton x:Name="ToolStripButtonAlignCenter" Command="EditingCommands.AlignCenter" ToolTip="Align Center" >
                                    <Image Source="..\Images\AlignCenter.png" Stretch="None"/>
                                </ToggleButton>
                                <ToggleButton x:Name="ToolStripButtonAlignRight" Command="EditingCommands.AlignRight" ToolTip="Align Right" >
                                    <Image Source="..\Images\AlignRight.png" Stretch="None"/>
                                </ToggleButton>
                                <Separator/>
                                <Button x:Name="ToolStripButtonBulletList" Command="EditingCommands.ToggleBullets" ToolTip="Bullets">
                                    <Image Source="..\Images\BulletList.png" Stretch="None"/>
                                </Button>
                                <Button x:Name="ToolStripButtonNumbersList" Command="EditingCommands.ToggleNumbering" ToolTip="Numbers">
                                    <Image Source="..\Images\NumbersList.png" Stretch="None"/>
                                </Button>
                                <Separator/>
                                <Button x:Name="ToolStripButtonIndent"  Command="EditingCommands.IncreaseIndentation" CommandTarget="{Binding ElementName=txtArea}" ToolTip="Increase Indent">
                                    <Image Source="..\Images\Indent.png" Stretch="None"/>
                                </Button>
                                <Button x:Name="ToolStripButtonIndentDelete" Command="EditingCommands.DecreaseIndentation" CommandTarget="{Binding ElementName=txtArea}" ToolTip="Decrease Indent">
                                    <Image Source="..\Images\IndentRemove.png" Stretch="None"/>
                                </Button>
                                <Separator/>
                              </ToolBar>
                            <RichTextBox x:Name ="txtArea" DockPanel.Dock="Top" AcceptsTab="True" AcceptsReturn="True">
                                
                            </RichTextBox>
                        </DockPanel>
                    </Border>
        
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>